package com.consumer;

import org.springframework.boot.SpringApplication;
import org.springframework.cloud.client.SpringCloudApplication;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

//@SpringBootApplication
//@EnableEurekaClient // 开启Eureka注册中心客户端发现功能
//@EnableCircuitBreaker // 开启Hystrix熔断器
@SpringCloudApplication // 该注解可替代以上三个注解
@EnableFeignClients // 开启Feign功能
public class ConsumerApplication {

	public static void main(String[] args) {
		SpringApplication.run(ConsumerApplication.class, args);
	}

	@Bean
	@LoadBalanced // 开启Ribbon负载均衡
	public RestTemplate restTemplate() {
		return new RestTemplate();
	}
}
